<template>
  <div class="seeFujianForList">
    <div class="fujianContent">
      <div class="fujianName">
        <i class="el-icon-document icon"></i>
        <el-tooltip
          v-if="fileObj && fileObj.length>0"
          effect="dark"
          :content="fileObj[0].name"
          placement="top-start"
        >
          <p
            class="el-tooltip fujianNamePdf item"
            aria-describedby="el-tooltip-4737"
            tabindex="0"
          >{{fileObj[0].name}}</p>
        </el-tooltip>
      </div>
      <div class="isHover">
        <span v-if="!download" @click="chakan">查看</span>
        <a :href="fileUrl" v-if="download">下载</a>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "seeFujianForList",
  props: ["fileObj","fileNum","download","fileItem","fileIndex","fileUrl"],
  data() {
    return {
      checked: true,
      optionList: []
    };
  },
  watch: {},
  methods: {
    chakan(){
        console.log(this.fileIndex,"ssssssssssssssssssssssssssssssssss")
      if(this.fileIndex || this.fileIndex === 0){
        this.$emit("openPdf",this.fileIndex,this.fileNum)
        console.log("111")
      }else{
        this.$emit("openPdf",this.fileNum)
        console.log("222")
      }
    },
  },
  created() {
    console.log(this.fileObj)
  }
};
</script>

<style lang="scss" scoped>

.fujianContent {
    background: #f5f8fa;
    width: 280px;
    border-radius: 6px;
    padding-left: 10px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
}
.fujianContent:hover .isHover {
  display: block;
}
.fujianName {
    font-size: 14px;
    font-weight: bold;
    color: #606266;
    cursor: pointer;
    margin-right: 20px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    width: 210px;
}
.fujianName .icon {
    display: block;
    font-size: 20px;
    margin-right: 10px;
    color: #409eff;
}
.fujianName .fujianNamePdf {
    margin: 0px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}
.isHover {
    color: #409eff;
    font-size: 13px;
    width: 46px;
    display: none;
}
.isHover span{
  cursor: pointer;
}
</style>
